1. Field of the Invention
The invention relates to a method for automatically detecting the contours of structures having a high X-ray absorption in an X-ray image. The invention also relates to an X-ray apparatus for carrying out such a method.
2. Description of Related Art
In radiological practice there are a variety of structures with a high X-ray absorption whose contours must be detected so as to enable optimum processing of the X-ray image:
1. The contours of the shutters whereby the X-ray beam striking a patient in the examination zone is restricted. Exact knowledge of the orientation in space of the shutter contours in an X-ray image can be used in various ways:
a) The dynamic range of a monitor or a so-called hardcopy unit can be automatically adapted to the image section enclosed by the shutter contours in such a manner that the contrasts are optimally reproduced (so-called auto ranging).
b) Upon output of an X-ray image, the region covered by the shutters can be reproduced in black or in color. If this step is not taken, these parts of the image would be very bright and could dazzle the observer.
c) The images can be rotated and, in the case of oblique projection, corrected so that the shutter contours extend horizontally and vertically in the image reproduced. Moreover, a plurality of images can be arranged adjacent to one another in such a manner that the surface area available on a monitor or a hardcopy is optimally used.
d) The image processing methods to be applied to the X-ray image can be limited to the section defined by the shutter contours. The amount of calculation work required for image processing can thus be significantly reduced.
2. The contours of implants in an X-ray image, for example of an artificial hip, Such implants have an X-ray absorption which is greater than that of bones but less than that of the X-ray diaphragm. The presence of such an implant in an X-ray image changes the mean gray scale value (image value) and other statistical properties of a gray scale histogram of the X-ray image. Consequently, it may happen that the automatic setting, derived from the X-ray image, of a display unit for displaying the X-ray image is not optimum. Improvements in this respect would be possible if the regions of the X-ray image in which the implant is reproduced were excluded from the histogram analysis on which the contrast setting of the display apparatus is based.
U.S. Pat. No. 5,651,042 already discloses a method for the automatic detection of shutter contours in an X-ray image wherein contour point candidates (i.e. pixels which could be situated on the contour of the shutter) are determined from the spatial variation of the image values associated with the pixels of the X-ray image (or a source image derived therefrom). The contour point candidates can be derived from a gradient image (or a high-pass image), derived from the source image, as those points for which the gradient exhibits a maximum. Using so-called linear regression, straight line candidates are calculated from such contour point candidates, which lines are arranged so that the contour point candidates lie thereon or in the immediate vicinity thereof. The line candidates may (but need not) be coincident with the shutter contours. Generally speaking, more line candidates appear as there are contours of the shutter. From these line candidates those lines are selected (4 at the most) which correspond best to one of 14 archetypes of shutter contours stored in a library. It is a prerequisite for this method that the shutter contours extend in parallel or at right angles to one another, and that the area enclosed by the shutter contours is centrally situated.
These conditions are not always satisfied in radiological practice. Even when the X-rays are confined by means of pairs of shutters extending parallel and perpendicularly to one another, the shutter contours in the X-ray image will no longer extend parallel or perpendicular to one another in the case of oblique projection. It may also occur that a part of the examination zone in which the X-ray beam is incident is covered by a lead apron or the like, the boundary of which extends parallel or perpendicular to the diaphragm edges in the X-ray image only in rare cases. The X-ray image is more likely to contain a contour which no longer coincides with a rectangle.
Moreover, digital X-ray image converters which convert the X-ray image into electric signals that can be digitized may have comparatively large dimensions (for example, 43 cmxc3x9743 cm). If, for example, only a hand or a finger is imaged by means of such an X-ray image converter, the X-ray image defined by the shutters usually will not be situated at the center but near the edge.
The same limitation holds for the method which is known from U.S. Pat. No. 5,081,680 and wherein points exhibiting a maximum gradient and situated on various straight lines through the center are determined. If more than two of such points are present on a straight line, as it will always be the case in a normal X-ray image with skeleton structures, the additional points must be excluded in a separate ranking process. The remaining points are considered to be points situated on the shutter contour, and a number of straight lines, forming a polygon, is derived from such shutter contour points by means of a Hough transformation; these lines are to represent the shutter contour.
Citation of a reference herein, or throughout this specification, is not to construed as an admission that such reference is prior art to the Applicant""s invention of the invention subsequently claimed.
It is an object of the present invention to provide a method for the automatic detection of the contours of structures having a high X-ray absorption which can be reliably performed and is not restricted to given contour shapes. This object is achieved according to the invention by taking the following steps: determining a number of closed paths which serve as contour candidates in an X-ray image or an image derived therefrom, selecting, in dependence on the contrasts along the closed paths, the contour as a closed path from the number of closed paths.
Thus, according to the invention a number of closed paths is derived in the image, one of said closed paths representing the contour searched. According to the invention no individual segments of the closed paths are analyzed and rejected or confirmed, and paths having a given shape are not selected either. The underlying consideration is that along the contour particularly strong contrasts arise between the image values inside and outside the image region defined thereby. The closed path along which the strongest contrasts occur is thus selected as the contour.
A method which is particularly suitable for determining a shutter contour includes the steps of determining contour point candidates from the spatial variation of the image values associated with the pixels of the X-ray image or a source image derived therefrom, determining line candidates from the contour point candidates in such a manner that a row of contour point candidates is situated on each line candidate or immediately adjacent to such a candidate, forming closed paths as shutter contour candidates composed of segments of different line candidates, and selecting a closed path as the shutter contour in dependence on the contrasts along the closed paths. Among the contour point candidates initially derived from the source image there are a large number in clinical practice which are not situated on a shutter contour. In this version however, no attempts are made to exclude such contour point candidates from further processing from the very start. They rather serve to determine line candidates on which, or in the immediate vicinity of which, the contour point candidates are situated. Such line candidates may form, at least partly, a part of the shutter contour; however, they may also be associated with an anatomical contour in the X-ray image.
Once more no attempts are made to exclude such line candidates from the further processing. Instead, closed paths (cyclic paths) are formed, i.e. polygons, whose start coincides with the end thereof. A plurality of closed paths can be composed from the segments of different line candidates. One of these closed paths represents the shutter contour. The selection of this one path as the shutter contour is based on the consideration that along the shutter contour particularly strong contrasts occur between the image values inside and outside the image region defined thereby.
The closed paths can in principle also be determined in a manner other than that previously described, for example by determining the spatial variation of the zero-crossings after LoG filtering of the X-ray image. The version previously described, however, can reliably detect a shutter contour even when only individual segments of a contour edge exhibit a strong contrast.
A method which is suitable for determining the contour of an implant includes the steps of applying a Laplacian-of-Gaussian filter to an X-ray image or an image derived therefrom, determination of the closed paths on which the zero-crossings of the Laplacian-of-Gaussian-filtered image are situated, and selecting a closed path as the implant contour in dependence on the contrasts along the closed paths. This method functions reliably for the contour detection of implants, because such contours generally exhibit a distinct contrast relative to their surroundings along their entire circumference. The determination of the closed paths requires only a short calculation time in this version.
A particularly effective version for the detection of a shutter contour includes the summing of the contrasts at the edges to both sides of one of several closed paths and the determination of the closed path along which the sum is maximum as the shutter contour. The summing of the contrasts along the closed path can be performed by forming a contour integral (Utot) along the closed path (s) of the direction derivative of the gradient (∇I) of the image values (I) in the direction of the path (s) in conformity with:
Utot=(n∇Ia)ds,
where n is a unit vector perpendicular to the closed path (s) and a is an exponent xe2x89xa71, or by forming the integral (Vtot) of the Laplacian operator (xcex94) over the region (a) enclosed by the closed path in conformity with:
Vtot=∫xcex94Ibda
It can be demonstrated that the previous formulas are mathematically identical and can be converted one into the another.
In practice there is a multitude of combinations of segments of the line candidates which form a closed path and hence constitute shutter contour candidates. The number of such shutter contour candidates can be significantly reduced by restricting the selection to closed paths which enclose a respective region within which the image values are larger than those outside this region. In this respect it is assumed that the region enclosed by a shutter contour always exhibits image values which are higher than those in the region covered by the shutters.
A preferred possibility for the determination of the contour point candidates includes selecting as contour point candidates those points in the X-ray image or in the source image in which the image values exhibit the largest gradients. However, the contour point candidates can also be derived from a high-pass image in which the points which are clearly distinct from their neighbors are also highlighted.
A preferred possibility for determining the line candidates from the contour point candidates includes deriving the line candidates from the contour point candidates by a Hough transformation. The line candidates can also be determined in a different manner, for example by means of linear regression as described in U.S. Pat. No. 5,651,042. The Hough transformation, however, offers the advantage that a shutter contour will be recognized as a line candidate even when it is interrupted by long regions in which it shows practically no contrast in the X-ray image.
The step of adjusting a frame around the source image, such that the pixels in this frame correspond to the image values in the region masked by shutters, ensures that the method for determining the shutter contour according to the invention offers a correct result even when no shutters are used for the formation of an X-ray image or when such shutters are opened so wide that their contours are not reproduced in the X-ray image.
It has been found that the contour of an implant is distinct from the contours of anatomical structures in the X-ray image on the one hand in that its contrast is higher and on the other hand in that the course of the contour is straighter (i.e. smoother or less xe2x80x9cirregularxe2x80x9d). This fact is used by the method wherein a closed path is automatically selected, from the number of closed paths, as an implant contour in dependence on a straightness measure evaluating the straightness of the closed paths. Both selection criteria (contrast and straightness) can be used in combination, but it is also possible to select the implant contour on the basis of only one of the two criteria. A preferred possibility for determining the degree of straightness is based on the relation between the distance between the first pixel and the last pixel in a segment of a closed path, which includes a number of neighboring pixels, and the length of this segment.
A preferred application of the method for the automatic detection of an implant contour includes suppressing the region enclosed by the determined implant contour during a further step of automatic contrast adjustment in dependence on the content of the X-ray image.
An X-ray apparatus for carrying out the method according to the invention includes an X-ray source for generating X-rays which traverse an examination zone, a shutter device which is arranged between the X-ray source and the examination zone, an X-ray image converter for detecting the X-rays behind the examination zone and for generating a corresponding source image, and an image processing unit for the detection of the contours of the shutter device in the source image, wherein the image processing unit is arranged to carry out the processing steps of this invention, namely: determining contour point candidates from the spatial variation of the image values associated with the pixels of the X-ray image or a source image derived therefrom, determining line candidates from the contour point candidates in such a manner that a row of contour point candidates is situated on each line candidate or immediately adjacent to such a candidate, forming a number of closed paths as shutter contour candidates composed of segments of different line candidates, and selecting a closed path, from the number of closed paths, as the shutter contour in dependence on the contrasts to both sides of the closed paths.